<?php
namespace app\index\controller;
use think\Db;
use think\Controller;

class IndexController extends Controller {

	function index(){
		$ads_list = db('ads')->order('add_time desc')->where('type',1)->select();
		$this->assign('ads_list',$ads_list);
		$goods_list = db('shop')
						->field('id,name,thumb,money')
						->limit(3)
						->select();
		$this->assign('goods_list',$goods_list);
		return $this->fetch();
	}
	
	public function logout() {
		session('user_id', null);
		return json(['code'=>200,'msg'=>'退出成功']);
	}
	public function xy() {
		return $this->fetch();
	}
}
